﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ANMCMaster.Master" AutoEventWireup="true" CodeBehind="RotatingBannerManager.aspx.cs" Inherits="AllNations.WebAppAdmin.RotatingBannerManager" %>
<%@ Register src="~/Controls/UserPageLeftNav.ascx" TagName="UserPageLeftNav" TagPrefix="ANMC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ANHeaderContent" runat="server">
    <script type="text/javascript">
        function ShareNewFile() {
            var frm = document.getElementById('<%= panelAddNewFile.ClientID %>');
            if (frm.style["display"] == "none") {
                frm.style["display"] = "block";
                var txtNavigationUrl = document.getElementById('<%= txtNavigationUrl.ClientID %>');
                txtNavigationUrl.focus();
            } else
                frm.style["display"] = "none";
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ANPageHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ANBodyContent" runat="server">
    <div class="leftnav">
        <div style="margin: 11px 0px 25px 0px;"><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/sectionTitleMembership.png" /></div>
        <ANMC:UserPageLeftNav ID="UserPageLeftNav1" runat="server" Selected="RotatingImageManager" />
    </div>
    <div class="rightcontentarea">
        <div id="contentBoxHolder">
            <div class="ContentTitleBar">
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/titleHomepageImageManager.png" />
            </div>
                <asp:Panel ID="panelAddNewFile" runat="server" style="display:none">
                    <asp:HiddenField ID="hidRotatingBannerId" runat="server" />
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td style="padding: 4px">Select new file:</td>
                            <td style="padding: 4px"><telerik:RadUpload ID="fuNewFile" runat="server" MaxFileInputsCount="1" ControlObjectsVisibility="None" /></td>
                        </tr>
                        <tr>
                            <td style="padding: 4px">URL:</td>
                            <td style="padding: 4px"><asp:TextBox ID="txtNavigationUrl" runat="server" Width="400px" /></td>
                        </tr>
                        <tr>
                            <td style="padding: 4px">&nbsp;</td>
                            <td style="padding: 4px">
                                <asp:Button ID="btSaveNewFile" runat="server" Text="Upload" OnClick="btSaveNewFile_Click" />
                                <asp:Button ID="btCancelUpload" runat="server" Text="Cancel" OnClientClick="ShareNewFile(); return false;" /><br />
                                <asp:Label ID="lblErrorMesg" runat="server" ForeColor="Red" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Repeater ID="rptRotatingImage" runat="server">
                <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" border="0" class="anmcList">
                        <tr class="header">
                            <td>Image</td>
                            <td>URL</td>
                            <td style="text-align: center">Order</td>
                            <td>&nbsp;</td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr style="vertical-align: middle">
                        <td style="vertical-align: middle; width: 250px;"><asp:Image runat="server" ImageUrl='<%# string.Format("~/Images/Main/{0}", Eval("image_filename_txt")) %>' Width="250px" /></td>
                        <td style="vertical-align: middle; width: 250px;"><%# Eval("navigation_url") %></td>
                        <td style="vertical-align: middle; text-align: center">
                            <div>
                                <asp:LinkButton runat="server" OnClick="MoveImagesClick" CommandName="MoveUp" CommandArgument='<%# Eval("rotating_banner_id") %>' Visible='<%# (int)Eval("priority_num") > 1 %>'><asp:Image runat="server" ImageUrl="~/Images/btn-arrow-up.gif" ImageAlign="AbsMiddle" /></asp:LinkButton>
                                <asp:Label runat="server" Text=" &nbsp; " Visible='<%# (int)Eval("priority_num") > 1 && !IsLastItem(Eval("priority_num")) %>' />
                                <asp:LinkButton runat="server" OnClick="MoveImagesClick" CommandName="MoveDown" CommandArgument='<%# Eval("rotating_banner_id") %>' Visible='<%# !IsLastItem(Eval("priority_num")) %>'><asp:Image runat="server" ImageUrl="~/Images/btn-arrow-down.gif" ImageAlign="AbsMiddle" /></asp:LinkButton></div>
                        </td>
                        <td style="vertical-align: middle;"><asp:LinkButton runat="server" ID="lnkDelete" CommandArgument='<%# Eval("rotating_banner_id") %>' OnClick="lnkDelete_Click" Text="Delete" OnClientClick="if (!confirm('You are about to delete an image, click OK to continue.')) return false;" /></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>
        <div style="clear: both;"></div>
    </div>
    <div style="clear: both;"></div>
</asp:Content>
